<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/29
  Time: 9:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        int a1 = (int)(Math.random()*10+1);
        int a2 = (int)(Math.random()*10+1);
        pageContext.setAttribute("a1",a1);
        pageContext.setAttribute("a2",a2);
    %>
    ${a1}...${a2}
    <hr/>
    //if判断
    <c:if test="${a1>a2}">
        asdfghj
    </c:if>
    <hr/>
    //相当于if..else 多分支结构
    <c:choose>
        <c:when test="${a1>6}">
            aaaa
        </c:when>
        <c:when test="${a1>4}">
            bbbb
        </c:when>
        <c:otherwise>
            cccc
        </c:otherwise>
    </c:choose>
</body>
</html>
